package com.xq.jltx.kotlinandroid

/**
 * @author jltxseo
 *         Created by junlintianxia on 2019/12/18.
 */
object PreferencesHelper {


    var boolVal: Boolean by SettingsPreferencesDelegate(
        "bool_bal",
        true
    )

    var intVal: Int by SettingsPreferencesDelegate(
        "int_val",
        1
    )

    var longVal: Long by SettingsPreferencesDelegate(
        "long_val",
        10000L
    )

    var floatVal: Float by
    SettingsPreferencesDelegate(
        "float_val",
        100.0F
    )

    var stringVal : String by SettingsPreferencesDelegate(
        "string_val",
        "写入数据"
    )

    var objVal : User by SettingsPreferencesDelegate(
        "obj_val",
        User(10L, "aidenquan")
    )

    val myUser by lazy {
        User(10L, "aidenquan")
    }

    lateinit var user : User

    fun ceshiUser() {
        user =     User(1000L, "aidenquan")
    }

}